package com.tenchael.iblog.web.wrapper;

import static com.tenchael.iblog.commons.Contants.ErrorCode.SUCCESS_CODE;

/**
 * Created by tenchael on 26/12/2017.
 */
public class RestWrapper<T> {
	private boolean success = true;
	private int code = SUCCESS_CODE;
	private T result;
	private String errMessage;

	public RestWrapper() {
	}

	public RestWrapper(T result) {
		this.result = result;
	}

	public RestWrapper(int code, String errMessage) {
		this.code = code;
		this.errMessage = errMessage;
		this.success = false;
	}

	public boolean isSuccess() {
		return success;
	}

	public void setSuccess(boolean success) {
		this.success = success;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}


	public T getResult() {
		return result;
	}

	public void setResult(T result) {
		this.result = result;
	}

	public String getErrMessage() {
		return errMessage;
	}

	public void setErrMessage(String errMessage) {
		this.errMessage = errMessage;
	}
}
